package  com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.dto.HouseDTO;
import com.itheima.dto.HouseDetail;
import com.itheima.entity.Houses;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
* houses 相关mapper
* @author Wei
* @since 2021-8-6 15:38:56
*/
@Repository
public interface HousesMapper extends BaseMapper<Houses>{
    @Select("SELECT  * from houses where  areaName like #{likeString}  limit 1;")
   Houses selectRandomOne(String likeString);

    List<HouseDTO> houseList(String areaId);


    HouseDetail selectHouseDetailById(int houseId);

    List<HouseDTO> selectLikes(Map map);

    Page<HouseDTO> selectByFilter(Page<HouseDTO> page, Map map);
}